package gewu.suleju.controller;

import gewu.suleju.util.WebSocketProcess;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("receive")
@RestController
public class BrokerReceiveMsg {
    @Autowired
    private WebSocketProcess webSocketProcess;
    @RequestMapping("msg")
    public void msg(String id,String message){//id和message是经纪人的信息
        try {
            webSocketProcess.sendMessage(Integer.parseInt(id),message);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

}
